package com.punch.order.design;


import com.alibaba.fastjson.JSONObject;
import com.punch.common.dto.order.OrderDTO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class PayContext {

    private PayStrategy payStrategy;

    public <T> PayContext(PayStrategy payStrategy) {
        this.payStrategy = payStrategy;
    }

    public PayStrategy payStrategy() {
        return payStrategy;
    }

    public void setOrderSignStrategy(PayStrategy payStrategy) {
        this.payStrategy = payStrategy;
    }

    public JSONObject payOrder(OrderDTO orderDTO) {
        return payStrategy.payOrder(orderDTO);
    }

    public String payNotify(HttpServletRequest request, HttpServletResponse response) {
        return payStrategy.payNotify(request, response);
    }

}
